<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Score</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
</head>
<body>
<h3>录入成绩</h3>
<div class="container">
    <div class="row">
        <div class="col-md-9 col-md-offset-1">
            <form action="" method="post">
            {% csrf_token %}
                <table class="table-bordered table table-stripped">
                <thead>
                <tr>
                    <th>学生姓名</th>
                    <th>考勤</th>
                    <th>成绩</th>
                    <th>批语</th>
                </tr>
                </thead>
                <tbody>
                {% for study_record in study_record_list %}
                    <tr>
                        <td>{{ study_record.student.username }}</td>
                        <td>{{ study_record.get_record_display }}</td>
                        <td width="160px">
                            <select name="score_{{ study_record.pk }}" id="" class="form-control" style="width: 100px;">
                                {% for score in score_choices %}
                                    {% if score.0 == study_record.score %}
                                    <option value="{{ score.0 }}" selected="selected">{{ score.1 }}</option>
                                    {% else %}
                                    <option value="{{ score.0 }}">{{ score.1 }}</option>
                                    {% endif %}
                                {% endfor %}
                            </select>
                        </td>
                        <td>
                            <textarea name="homework_note_{{ study_record.pk }}" id="" cols="26" rows="3" class="form-control">{{ study_record.homework_note }}</textarea>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
                <input type="submit" class="btn btn-info pull-right">
            </form>
        </div>
    </div>
</div>

</body>
</html>